<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--
<link href="css/bootstrap-theme.min.css" rel="stylesheet">
<script  type="text/javascript" src="js/bootstrap.min.js"></script>
<link href="css/bootstrap.min.css" rel="stylesheet">
<script  type="text/javascript" src="js/jquery.min.js"></script>
-->

<link  type="text/css" href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
   <script type="text/javascript" src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
   <script type="text/javascript" src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>

</head>
<script type="text/javascript">
$(function(){
    $("#registerForm").validation({icon:true});
	
	    //.注册
    $("#registerSubmit").on('click',function(event){
      // 2.最后要调用 valid()方法。
      //  valide(object,msg),提示信息显示，object位置后面增加提示信息。如不填object 则自动找最后一个button submit.
      //  valide(msg)
       alert(111);
      //第一种提示写法
      if ($("#registerForm").valid(this,'内容出错')==false){
        return false;
      }
     
      //第二种提示写法，回调方法你自己提示就随意你了。
      //if ($("#form1").valid(this,function(err){alert(err)})==false){
      //  return false;
      //}
      

      
    });
	}
</script>
<body>	
	    <div class="container">
    <div class="page-header">
      <h1>用户注册<small></small></h1>
    </div>
    


<form class="form-horizontal"  id="registerForm" action="#" role="form" method="post">
       
       <div class="form-group">
        <label for="inputPhone" class="col-sm-2 control-label">你的手机</label>
        <div class="col-sm-6">
          <input type="text" class="form-control" id="inputPhone" check-type="required mobile" name="phone">
        </div>
      </div>
       
      <div class="form-group">
        <label for="inputName" class="col-sm-2 control-label">学生姓名</label>
        <div class="col-sm-6">
          <input type="text" class="form-control" id="inputName" name="name" check-type="required" required-message="请填写学生姓名">
        </div>
      </div>
	  
	  <div class="form-group">
        <label for="inputSchool" class="col-sm-2 control-label">学生学校</label>
        <div class="col-sm-6">
          <input type="text" class="form-control" id="inputSchool" name="school" check-type="required" required-message="请填写学生学校。">
        </div>
      </div>
	  
	  <div class="form-group">
        <label for="inputClass" class="col-sm-2 control-label">年级和班级</label>
        <div class="col-sm-6">
          <input type="text" class="form-control" id="inputClass"  name="class" check-type="required" required-message="请填写年级和班级。">
        </div>
      </div>






       
   
       


      <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">
          <button type="submit" id="registerSubmit" class="btn btn-primary col-sm-4">注册</button>
          <button type="reset"  class="btn btn-primary col-sm-4">重置</button>
        </div>
      </div>


    </form>
  </div>
	
	
	
	
	
	
	
	
</body>
</html>